From cdcbb829dc55e4b913db4a7348b9ec3b7628c658 Mon Sep 17 00:00:00 2001 From: Leon Weber Date: Thu, 8 May 2008 15:01:40 +0000 Subject: [PATCH] (bug 14044) Don't increment page view counters on views from bot users --- RELEASE-NOTES | 2 +- includes/Article.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6614eb9fdb..e5e589372b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -260,7 +260,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13982) Disable ccmeonemails preference when user-to-user mails disabled * (bug 13615) Update case mappings and normalization to Unicode 5.1.0 Note that case mappings will only be used if mbstring extension is not present. - +* (bug 14044) Don't increment page view counters on views from bot users === API changes in 1.13 === diff --git a/includes/Article.php b/includes/Article.php index 6e714fae2c..8d9e5ea24e 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2594,11 +2594,12 @@ class Article { * @private */ function viewUpdates() { - global $wgDeferredUpdateList; + global $wgDeferredUpdateList, $wgUser; if ( 0 != $this->getID() ) { + # Don't update page view counters on views from bot users (bug 14044) global $wgDisableCounters; - if( !$wgDisableCounters ) { + if( !$wgDisableCounters && !$wgUser->isAllowed( 'bot' ) ) { Article::incViewCount( $this->getID() ); $u = new SiteStatsUpdate( 1, 0, 0 ); array_push( $wgDeferredUpdateList, $u ); @@ -2606,7 +2607,6 @@ class Article { } # Update newtalk / watchlist notification status - global $wgUser; $wgUser->clearNotification( $this->mTitle ); } -- 2.20.1